package com.example.dbsample.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.dbsample.model.entity.SysDictData;
import com.example.dbsample.model.entity.SysDictDataExample;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface SysDictDataMapper extends BaseMapper<SysDictData>  {
    long countByExample(SysDictDataExample example);

    int deleteByExample(SysDictDataExample example);

    int deleteByPrimaryKey(Long id);

    int insert(SysDictData record);

    int insertSelective(SysDictData record);

    List<SysDictData> selectByExample(SysDictDataExample example);

    List<SysDictData> selectByCondition(@Param("sysDictData") SysDictData sysDictData,
                                        @Param("offset") int offset,
                                        @Param("size") int size,
                                        @Param("versionList") List<Integer> versionList);

    List<SysDictData> selectByConditionV2(@Param("sysDictData") SysDictData sysDictData,
                                        @Param("offset") int offset,
                                        @Param("size") int size,
                                        @Param("versionList") List<Integer> versionList);
    SysDictData selectByPrimaryKey(Long id);

    int updateByExampleSelective(@Param("record") SysDictData record, @Param("example") SysDictDataExample example);

    int updateByExample(@Param("record") SysDictData record, @Param("example") SysDictDataExample example);

    int updateByPrimaryKeySelective(SysDictData record);

    int updateByPrimaryKey(SysDictData record);

    Integer batchSave(List<SysDictData> list);
    Integer batchSaveV2(List<SysDictData> list);
    Integer batchUpdate(List<SysDictData> list);
    Integer batchDeleteByIdList(@Param("idList") List<Long> idList);
    int countByidList(@Param("idList") List<Long> idList);

    void deleteAndInsert(List<SysDictData> sysDictDataList);

    /**
     * TODO 尚未验证：用来测试type handler的
     * @param list
     */
    void insertForTypeHandlerTest(@Param("list") List<SysDictData> list);
}